#include "backHelixes.h"
#include "../framework.h"

BackHelixes::BackHelixes(Rectangle rec)
	:Helixes(Rectangle(0,0,0,0)){
    this->theta=0;
    }

BackHelixes::~BackHelixes(){}

void BackHelixes::draw(){
	Framework& fr = Framework::instance();
	fr.pipeline.pushMatrix();
		Helix& helix = dynamic_cast<Helix&>(this->findObject(Helix::name()));
        fr.pipeline.rotate(theta);
		fr.pipeline.pushMatrix();
			fr.pipeline.escale(0.8,0.8);
			helix.draw();
		fr.pipeline.popMatrix();
		fr.pipeline.pushMatrix();
			fr.pipeline.escale(0.8,0.8);
			fr.pipeline.escale(1.0f,-1.0f);
            helix.draw();
        fr.pipeline.popMatrix();
        fr.pipeline.pushMatrix();
            fr.pipeline.escale(0.02f,0.02f);
            fr.pipeline.draw(Pipeline::CIRCLES,this->objVertices.vertices,this->objVertices.nVertices);
		fr.pipeline.popMatrix();
	fr.pipeline.popMatrix();
}

void BackHelixes::timeStep(){
    theta +=200.0f;
}


